x86: move and fold certain type property definitions
authorJan Beulich <jbeulich@suse.com>
Thu, 12 Jan 2012 15:43:55 +0000 (16:43 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 12 Jan 2012 15:43:55 +0000 (16:43 +0100)
Not only is it less code to have them consolidated, it also permits
their use virtually everywhere (since config.h is required to be
included everywhere. (Shouldn't we, btw, follow Linux and remove the
explicit inclusion in favor of command line enforced one?)

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/include/asm-x86/config.h
xen/include/asm-x86/types.h

index 40a7b8c2c95e8ed8ec0c26e81cf77a89b3f15424..c5dd02a3ed5750ba5c189076877c1576aceb3b7c 100644 (file)
@@ -8,11 +8,16 @@
 #define __X86_CONFIG_H__
 
 #if defined(__x86_64__)
+# define LONG_BYTEORDER 3
 # define CONFIG_PAGING_LEVELS 4
 #else
+# define LONG_BYTEORDER 2
 # define CONFIG_PAGING_LEVELS 3
 #endif
 
+#define BYTES_PER_LONG (1 << LONG_BYTEORDER)
+#define BITS_PER_LONG (BYTES_PER_LONG << 3)
+
 #define CONFIG_X86 1
 #define CONFIG_X86_HT 1
 #define CONFIG_PAGING_ASSISTANCE 1
index 35b920c69b1247092160cd5fa9e330a4af98c6fc..b945da0932b9dd249925ebb4d1d5103a683d510e 100644 (file)
@@ -55,14 +55,4 @@ typedef char bool_t;
 
 #endif /* __ASSEMBLY__ */
 
-#if defined(__i386__)
-#define BITS_PER_LONG 32
-#define BYTES_PER_LONG 4
-#define LONG_BYTEORDER 2
-#elif defined(__x86_64__)
-#define BITS_PER_LONG 64
-#define BYTES_PER_LONG 8
-#define LONG_BYTEORDER 3
-#endif
-
 #endif /* __X86_TYPES_H__ */